﻿<%@ WebHandler Language="C#" Class="fav" %>

using System;
using System.Web;
using LP580.CG;
public class fav : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/plain";
        string type = Utils.RF_str("t");//收藏类别（g为礼品，c为公司)
        int id = Utils.RF_int("id");
        int uid = 9;// clsUserAccount.getCookieUser(true).UserID;
        switch (type)
        {
            case "g":
                clsFavoriteGiftProduct cfgp = new clsFavoriteGiftProduct();
                cfgp.GiftProductID = id;
                cfgp.UserID = uid;
                clsFavoriteGiftProduct.Insert(cfgp);
                context.Response.Write("ok");
                break;
            case "c":
                clsFavoriteCompany cfc = new clsFavoriteCompany();
                cfc.CompanyID = id;
                cfc.UserID = uid;
                clsFavoriteCompany.Insert(cfc);
                context.Response.Write("ok");
                break;
            default:
                break;
        }
        context.Response.End();
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}